The present invention relates generally to the field of computer code compilation, and more particularly to just-in-time (JIT) compiler performance optimization.
Bytecode is a binary representation of program code that is an intermediate representation between source code and machine code. Bytecode is typically more “portable” than machine code, meaning that bytecode tends to reduce code dependence on a limited set of hardware and/or operating system environments. At the same time, bytecode is also typically more efficient than source code in that it can usually be translated into machine code (also called “native machine language”) during runtime much faster than source code can be translated into machine code. Bytecode may be “compiled” into native machine language for execution, or it may be executed on a virtual machine that “interprets” the bytecode as it runs. Different sections of the bytecode used in a single program can be handled in different ways. For example, some sections may be compiled, while others are interpreted.
Just-in-time (JIT) compilation, also referred to as dynamic translation, is a method for compiling software code from a source format, such as bytecode, to native machine language. JIT compilation is a hybrid approach to code conversion, with compilation occurring during runtime, similar to how interpreters operate during runtime, but in chunks, as with traditional, ahead-of-time compilers. Often, there is caching of compiled code (also called “translated code”) to improve performance.
Some compilers, including some JIT compilers, have the ability to compile code to varying degrees of “code optimization.” Typically, the greater the degree of code optimization, the faster the code executes, but this optimized code generally comes at a cost, including longer compilation times.
JAVA is a well-known, class-based, object-oriented computer programming language. In the context of JAVA, a “method” is a subroutine, or procedure, associated with a class. JAVA source format code is typically translated to bytecode that can be run on a JAVA Virtual Machine (JVM) regardless of the underlying hardware or software platform. JVMs often employ JIT compilation to convert JAVA bytecode into native machine code, which can: (i) improve application runtime performance (for example, speed) relative to interpretation; and (ii) include late-bound data types and adaptive optimization, unlike ahead-of-time compilation. (Note: the term(s) “JAVA” may be subject to trademark rights in various jurisdictions throughout the world and are used here only in reference to the products or services properly denominated by the marks to the extent that such trademark rights may exist.)